﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using phudieuhungthinh.DAL.Repositories;
using canthovieclam.Core.Utilities;

namespace phudieuhungthinh.Console
{
    class Program
    {
        static void Main(string[] args)
        {

            var producRepository = new ProductRepository();

            var products = producRepository.GetAllProduct();

            foreach (var item in products)
            {
                item.Url = StringUtil.RemoveSign4VietnameseString(item.Name.ToLower()).Replace(' ', '-');
                item.UniqueID = GuidUtils.NewSeqGuid();
                producRepository.UpdateProduct(item);
            }

            producRepository.Commit();

            System.Console.WriteLine("Done");
        }
    }
}
